/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 微信支付回调 POST /api/pay/notifyMnp */
export async function notifyMnpUsingPost({
  body,
  options,
}: {
  body: string;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/pay/notifyMnp', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 支付状态 GET /api/pay/payStatus */
export async function payStatusUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.payStatusUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultzhifuzhuangtaiVo>('/api/pay/payStatus', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 支付方式 GET /api/pay/payWay */
export async function payWayUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.payWayUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultzhifufangshiliebiaoVo>('/api/pay/payWay', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 发起支付 POST /api/pay/prepay */
export async function prepayUsingPost({
  body,
  options,
}: {
  body: API.yuzhifudingdancanshu;
  options?: CustomRequestOptions;
}) {
  return request<API.AjaxResultobject>('/api/pay/prepay', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
